package com.googlecode.utterlyidle.authentication;

public class Credential {
    public final String username;
    public final String password;

    public Credential(String username, String password) {
        this.username = username;
        this.password = password;
    }

    public static Credential credential(final String username, final String password) {
        return new Credential(username, password);
    }

    @Override
    public boolean equals(Object obj) {
        if(obj == null || !(obj instanceof  Credential)) return false;
        return username.equals(((Credential) obj).username) && password.equals(((Credential) obj).password);
    }

    @Override
    public int hashCode() { return username.hashCode() * password.hashCode() * 31; }
}
